#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main(){
	int N, M;
	int max, min;
	scanf("%d%d", &N, &M);
	if (N<M){
		int t = M;
		M = N;
		N = t;
	}
	for (int i = 1; i <= N; i++){

		if (N%i == 0 && M%i == 0){
			max = i;
		}
	}
	min = M / max*N;
	printf("%d %d", max, min);
	return 0;
}

